<?php
$file = base64_decode($_GET['file']);


if (strstr('/', $file)) { 
    $name = explode('/', $file);
}
else {
    $name = explode('\\', $file);
}

$name = end($name);

$ext = explode('.', $name);
$ext = end($ext);

header('Content-disposition: attachment; filename='.$name);
header('Content-type: application/'.$ext);
header("Content-Length: ".  filesize($file)); 
readfile($file);
?> 

